
	<?php if( !empty($arBranch) ): ?>

		<?php foreach($arBranch as $tree): ?>

			<div class="title"><?php echo $tree['obj']->getName() ?></div><br />

			<div class="naujiena">
				<?php if( $tree['obj']->getChildrenQnt() ): ?>
					<?php foreach($tree['children'] as $child): ?>
						<div class="galerija_event">
							<div class="galerija_data"><?php echo $child['obj']->getUpdatedAt('Y-m-d')?></div>
							<div class="galerija_title">
								<?php echo link_to($child['obj']->getName(), 'photos/gallery?id=' . $child['obj']->getId()) ?><br />
							</div>
						</div>
					<?php endforeach; ?>
				<?php endif; ?>
				
				<?php if( $tree['obj']->getObjId() ): ?>
					<?php $module = TextModule::getById($tree['obj']->getObjId());?>
					<?php $module->setCulture($sf_user->getCulture());?>
					<div class="galerija_event">
						<div class="galerija_data"><?php echo $module->getUpdatedAt('Y-m-d'); ?></div>
						<div class="galerija_title">
							<?php echo $module->getName(); ?>
						</div>
						<div class="galerija_line">
							<?php $arPics = Files::GetByObj($module->getId()); ?>
							<?php foreach( $arPics as $pic ): ?>
								<a href="/web/images/gallery/medium/<?php echo $pic->getUname(); ?>"><img src="http://www.ttlazdynai.lt/web/images/gallery/tiny/<?php echo $pic->getUname(); ?>" /></a>
							<?php endforeach; ?>
						</div>
					</div>
				<?php endif; ?>
			</div>

		<?php endforeach; ?>

	<?php endif; ?>